--- import Layout from '@layouts/Layout.astro'; import SectionList from '@components/things/SectionList.astro'; import Main from '@components/scafold/MainCard.astro'; import { fetchData, slugify } from '@utils/fetch-data'; import { truncate } from '@utils/meta-tags'; import type { Section } from '../types/Service'; import Button from '@components/form/Button.astro'; interface Props { title: string; sections: Section[]; } const { title, sections } = Astro.props; const categories = (await fetchData()).categories; export async function getStaticPaths() { const pages = await fetchData().then((data) => { return data.categories.map((category) => { return { category: slugify(category.name), title: category.name, sections: category.sections, }; }); }); return pages.map(({ category, title, sections }) => { return { params: { category }, props: { title, sections }, }; }); } const makeCarasolData = () => { return { '@context': 'https://schema.org', '@type': 'ItemList', itemListElement: sections.map((section, index) => ({ '@type': 'ListItem', position: index + 1, name: section.name, url: `https://awesome-privacy.xyz/${slugify(title)}/${slugify(section.name)}/`, })), }; }; const makeBreadcrumbs = () => { return [ { name: 'Home', item: '/' }, { name: title, item: slugify(title) }, ]; }; const makeDescriptionTag = () => truncate( `Privacy-respecting ${title.toLowerCase()}: ` + `${sections.map((section) => section.name).join(', ')}. ` + `Compare free, open source and secure alternatives.`, ); const makePaginationLinks = () => { const index = categories.findIndex((category) => category.name === title); const previousCategory = index > 0 ? categories[index - 1].name : null; const nextCategory = index < categories.length - 1 ? categories[index + 1].name : null; return { previous: previousCategory, next: nextCategory }; }; const { previous, next } = makePaginationLinks(); ---
Or, Browse All {title}
{ previous ? ( ) : (

) } { next && ( ) }